/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ACH.app.util;

import java.io.IOException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author adriancruz11c
 */
public class ReadingDataDB{
    
    private ObjData objData = null;
     protected ReadingDataDB() {
  }
/*
  public static ReadingDataDB getInstance() {

    if (readingDataDB== null) {
      readingDataDB= new ReadingDataDB();
    }
    return readingDataDB;
  }*/

  public ObjData getObjData() {

    if (objData == null) {
      objData = new ObjData();
    }
    return objData;
  }
  

      
  public class ObjData{
        private String bdHost;
        private String bdPort;
        private String bdUsuario;
        private String bdPassword;
        private String bdNombre;
        private String bdWordNet;
        private String bdEuroWN;
        private String SEGoogleSearchURL;
        private String SEGoogleKey;
        private String SEGoogleCount;
        private String SEGoogleClientID;
        private int SEGoogleMaximusQuerys;
        private String apiWordRfURL,apiWordRfURI, apiWordRfKEY;
       
        private Properties properties;
        private String user;
        private String passwd;
        private String host;
        private int port;
        private String from;
        private boolean starttlsenable;
        private String subject;
        private String tailbody;
        private String link;
        private boolean auth;
        private String body;
    public ObjData() {
      setDefaultConfiguration();
    }
      
      private void setDefaultConfiguration() {
          try {
        properties = new Properties();
        properties.load(getClass().getResourceAsStream("/ACH/app/property/config.properties"));

        user = properties.getProperty("mail.smtp.user");
        passwd = properties.getProperty("mail.smtp.passwd");
        host = properties.getProperty("mail.smtp.host");
        port = Integer.parseInt(properties.getProperty("mail.smtp.port"));
        from = properties.getProperty("mail.smtp.from");
        auth = Boolean.getBoolean(properties.getProperty("mail.smtp.auth"));
        starttlsenable = Boolean.getBoolean(properties.getProperty("mail.smtp.starttls.enable"));
        subject = properties.getProperty("mail.smtp.subject");
        body = properties.getProperty("mail.smtp.body");
        tailbody = properties.getProperty("confirm.mail.tail");
        link = properties.getProperty("confirm.mail.link");
       // repoDocs=properties.getProperty("");
        bdHost = properties.getProperty("bd.Host");
        bdPort=properties.getProperty("bd.Port");
        bdUsuario=properties.getProperty("bd.Usuario");
        bdPassword=properties.getProperty("bd.Password");
        bdNombre=properties.getProperty("bd.Nombre");
        bdWordNet=properties.getProperty("bd.WordNet");
        bdEuroWN=properties.getProperty("bd.EuroWN");
        SEGoogleSearchURL=properties.getProperty("SearchE.Google.GOOGLE_SEARCH");
        SEGoogleCount=properties.getProperty("SearchE.Google.count");
        this.SEGoogleKey=properties.getProperty("SearchE.Google.Key");
        this.SEGoogleClientID=properties.getProperty("SearchE.Google.ClientID");
        this.SEGoogleMaximusQuerys=Integer.parseInt(properties.getProperty("SearchE.Google.MaximusQuerys"));
        apiWordRfURL=properties.getProperty("api.wordRef.URL");
        apiWordRfURI=properties.getProperty("api.wordRef.URI");
        apiWordRfKEY=properties.getProperty("api.wordRef.key");

        //properties.getProperty("");
        
      } catch (IOException ioe) {
        //Logger.getLogger(ReadingDataDB.class.getName()).log(Level.SEVERE, null, ioe);
          Logger.getLogger(ObjData.class.getName()).log(Level.SEVERE, null, ioe);
      }
      }

        public String getApiWordRfKEY() {
            return apiWordRfKEY;
        }

        public String getApiWordRfURI() {
            return apiWordRfURI;
        }

        public String getApiWordRfURL() {
            return apiWordRfURL;
        }

      
        public String getSEGoogleCount() {
            return SEGoogleCount;
        }

        public String getSEGoogleClientID() {
            return SEGoogleClientID;
        }

        public String getSEGoogleSearchURL() {
            return SEGoogleSearchURL;
        }

        public void setSEGoogleClientID(String SEGoogleClientID) {
            this.SEGoogleClientID = SEGoogleClientID;
        }

        public String getSEGoogleKey() {
            return SEGoogleKey;
        }

        public void setSEGoogleKey(String SEGoogleKey) {
            this.SEGoogleKey = SEGoogleKey;
        }

        public int getSEGoogleMaximusQuerys() {
            return SEGoogleMaximusQuerys;
        }

        public void setSEGoogleMaximusQuerys(int SEGoogleMaximusQuerys) {
            this.SEGoogleMaximusQuerys = SEGoogleMaximusQuerys;
        }

        public boolean isAuth() {
            return auth;
        }

        public void setAuth(boolean auth) {
            this.auth = auth;
        }

        public String getBdEuroWN() {
            return bdEuroWN;
        }

        public void setBdEuroWN(String bdEuroWN) {
            this.bdEuroWN = bdEuroWN;
        }

        public String getBdHost() {
            return bdHost;
        }

        public void setBdHost(String bdHost) {
            this.bdHost = bdHost;
        }

        public String getBdNombre() {
            return bdNombre;
        }

        public void setBdNombre(String bdNombre) {
            this.bdNombre = bdNombre;
        }

        public String getBdPassword() {
            return bdPassword;
        }

        public void setBdPassword(String bdPassword) {
            this.bdPassword = bdPassword;
        }

        public String getBdPort() {
            return bdPort;
        }

        public void setBdPort(String bdPort) {
            this.bdPort = bdPort;
        }

        public String getBdUsuario() {
            return bdUsuario;
        }

        public void setBdUsuario(String bdUsuario) {
            this.bdUsuario = bdUsuario;
        }

        public String getBdWordNet() {
            return bdWordNet;
        }

        public void setBdWordNet(String bdWordNet) {
            this.bdWordNet = bdWordNet;
        }

        public String getBody() {
            return body;
        }

        public void setBody(String body) {
            this.body = body;
        }

        public String getFrom() {
            return from;
        }

        public void setFrom(String from) {
            this.from = from;
        }

        public String getHost() {
            return host;
        }

        public void setHost(String host) {
            this.host = host;
        }

        public String getLink() {
            return link;
        }

        public void setLink(String link) {
            this.link = link;
        }

        public String getPasswd() {
            return passwd;
        }

        public void setPasswd(String passwd) {
            this.passwd = passwd;
        }

        public int getPort() {
            return port;
        }

        public void setPort(int port) {
            this.port = port;
        }

        public Properties getProperties() {
            return properties;
        }

        public void setProperties(Properties properties) {
            this.properties = properties;
        }

        public boolean isStarttlsenable() {
            return starttlsenable;
        }

        public void setStarttlsenable(boolean starttlsenable) {
            this.starttlsenable = starttlsenable;
        }

        public String getSubject() {
            return subject;
        }

        public void setSubject(String subject) {
            this.subject = subject;
        }

        public String getTailbody() {
            return tailbody;
        }

        public void setTailbody(String tailbody) {
            this.tailbody = tailbody;
        }

        public String getUser() {
            return user;
        }

        public void setUser(String user) {
            this.user = user;
        }

       
    
}
     // private static ReadingDataDB readingDataDB=null;   
      
}